﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
using Pay.DTO;
using Pay.TO;

namespace Pay.IService {
	public interface IPayService {
		/// <summary>
		/// 生成二维码扫码请求通道封装
		/// </summary>
		/// <returns>The pay gateway.</returns>
		/// <param name="obj">Model.</param>
		Task<native_result> NativePay(native_model obj);
		/// <summary>
		/// 商城支付请求通道封装
		/// </summary>
		/// <param name="obj"></param>
		/// <returns></returns>
		Task<mall_result> MallPay(mall_model obj);
		/// <summary>
		/// 返回的是第三方的商户号，opt：A增加，M修改
		/// </summary>
		/// <returns>The register.</returns>
		/// <param name="dto">Dto.</param>
		/// <param name="opt">A增加，M修改.</param>
		Task<merchant_register_result> MerchantRegister(merchant_register_model dto, string opt);
		/// <summary>
		/// 商户信息登记
		/// </summary>
		/// <param name="bind_id"></param>
		/// <returns></returns>
		Task<merchant_register_result> MerchantRegister(long bind_id, string settle_type,PayChannel channel = PayChannel.None);
		/// <summary>
		/// 商户信息修改
		/// </summary>
		/// <param name="bind_id"></param>
		/// <returns></returns>
		Task<merchant_register_result> MerchantModify(long bind_id, string settle_type,PayChannel channel = PayChannel.None);

		/// <summary>
		/// 回调支付通知，商户返回OK，不再回调了，流程是先调用orderservice的NotifyOrder，
		/// 返回值判断是调用哪个通道，再调用本方法，最后调用orderservice的Update
		/// </summary>
		/// <returns>The notify.</returns>
		/// <param name="order_no">Order.</param>
		Task<string> Notify(string merchant_no, string order_no);
		/// <summary>
		/// 代付通知
		/// </summary>
		/// <returns>The transfer.</returns>
		/// <param name="order_no">Order.</param>
		Task<string> NotifyTransfer(string merchant_no, string order_no);

		/// <summary>
		/// 查询代付额度
		/// </summary>
		/// <returns>The quota.</returns>
		/// <param name="merchant_no"></param>
		/// <param name="busiType">0：对公 1：对私</param>
		Task<quota_result> Quota(string merchant_no, string busiType);

		/// <summary>
		/// HF快捷支付鉴权,其它待定
		/// </summary>
		/// <returns>The receive.</returns>
		/// <param name="model">Model.</param>
		Task<quick_pay_result> QuickPay(quick_pay_model model);
		/// <summary>
		/// HF快捷支付鉴权成功后发短信
		/// </summary>
		/// <returns>The pay resms.</returns>
		/// <param name="model">Model.</param>
		Task<ApiResultMessage> QuickPaySendsms(quick_sendsms_model model);
		/// <summary>
		/// HF确认短信验证码后支付
		/// </summary>
		/// <returns>The pay.</returns>
		/// <param name="model">Model.</param>
		Task<quick_pay_result> QuickPay(quick_sms_model model);
		/// <summary>
		/// 快捷支付查询
		/// </summary>
		/// <returns>The pay query.</returns>
		/// <param name="model">Model.</param>
		Task<pay_notity> QuickPayQuery(refund_model_query model);
		/// <summary>
		/// 快捷支付退款
		/// </summary>
		/// <returns>The pay refund.</returns>
		/// <param name="model">Model.</param>
		Task<refund_result> QuickPayRefund(refund_model model);
		/// <summary>
		/// 快捷支付退款查询,并将退款中的单处理为完成
		/// </summary>
		/// <returns>The pay refund.</returns>
		/// <param name="model">Model.</param>
		Task<refund_result> QuickPayRefundQuery(refund_model_query model);

		/// <summary>
		/// 网关支付银行
		/// </summary>
		/// <returns>The pay bank.</returns>
		List<type_setting> GatewayPayBank();
		/// <summary>
		/// 发起网关支付
		/// </summary>
		/// <returns>The receive.</returns>
		/// <param name="model">Model.</param>
		Task<gateway_pay_result> GatewayPay(gateway_pay_model model);
		/// <summary>
		/// 网关支付查询
		/// </summary>
		/// <returns>The pay query.</returns>
		/// <param name="model">Model.</param>
		Task<pay_notity> GatewayPayQuery(refund_model_query model);
		/// <summary>
		/// 网关支付退款
		/// </summary>
		/// <returns>The pay refund.</returns>
		/// <param name="model">Model.</param>
		Task<refund_result> GatewayPayRefund(refund_model model);
		/// <summary>
		/// 网关支付退款查询,并将退款中的单处理为完成
		/// </summary>
		/// <returns>The pay refund.</returns>
		/// <param name="model">Model.</param>
		Task<refund_result> GatewayRefundQuery(refund_model_query model);

		/// <summary>
		/// 单笔代付
		/// </summary>
		/// <returns>The transfer.</returns>
		/// <param name="model">Model.</param>
		Task<transfer_result> Transfer(apply_transfer model);
		/// <summary>
		/// 再原来提现单上重新代付
		/// </summary>
		/// <returns>The transfer.</returns>
		/// <param name="id">Identifier.</param>
		Task<transfer_result> ReTransfer(long id);
		/// <summary>
		/// 代付批处理:生成代付文件，将批号写入提现表，生成代付文件记录，并上传FTP，FTP成功调用代付通知，FTP失败提示手动上传，并去文件记录管理手动代付通知。
		/// </summary>
		/// <returns>The transfer.</returns>
		/// <param name="model">Model.</param>
		Task<batch_transfer_result> Transfer(batch_transfer model);
		/// <summary>
		/// 提交代付批处理报盘通知（平台后台用）
		/// </summary>
		/// <returns>The transfer.</returns>
		/// <param name="batchId">Batch Id.</param>
		Task<int> TransferNotify(long batchId, string batchFileName, long merchant_id);
		/// <summary>
		/// 提交代付批处理查询，返回回盘文件地址后，进行提现记录更新（平台后台用）
		/// </summary>
		/// <returns>The transfer.</returns>
		/// <param name="batchId">Batch Id.</param>
		/// <param name="noticeTranId">报盘通知交易流水号</param>
		Task<int> TransferBack(long batchId, string noticeTranId, long merchant_id);
		/// <summary>
		/// 单笔代付查询
		/// </summary>
		/// <returns>The query.</returns>
		/// <param name="model">Model.</param>
		Task<transfer_result> TransferQuery(transfer_query model);

		/// <summary>
		/// 代收签约－会发短信
		/// </summary>
		/// <returns>The receive.</returns>
		/// <param name="model">Model.</param>
		Task<ApiResultMessage> InsteadReceive(verify_model model);
		/// <summary>
		/// 代收签约－提交短信验证码
		/// </summary>
		/// <returns>The receive.</returns>
		/// <param name="model">Model.</param>
		Task<ApiResultMessage> InsteadReceive(verify_model_sms model);
		/// <summary>
		/// 单笔代收
		/// </summary>
		/// <returns>The transfer.</returns>
		/// <param name="model">Model.</param>
		Task<transfer_result> AgencyFund(apply_receive model);
		/// <summary>
		/// 生成对账文件
		/// </summary>
		/// <returns>The to file.</returns>
		/// <param name="create_date">Create date.</param>
		/// <param name="type">Type.</param>
		Task<int> ItpToFile(DateTime create_date);
		/// <summary>
		/// 对账文件处理
		/// </summary>
		/// <returns>The itp.</returns>
		/// <param name="id">Identifier.</param>
		int DealItp(long id);
		/// <summary>
		/// 四要素认证
		/// </summary>
		/// <param name="model"></param>
		/// <returns></returns>
		Task<certify_verify_result> CertifyVerify(certify_verify model);
        /// <summary>
        /// token提现代付
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<transfer_result> TokenTransfer(long id);
        /// <summary>
        /// token提现代付查询
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        Task<transfer_result> TokenTransferQuery(transfer_query model);
    }
}
